package io.hilo.example.biz01.web.demo;

import java.util.HashMap;
import java.util.Map;

import org.hilo.boot.app.web.AbstractController;
import org.hilo.boot.core.UT;
import org.jretty.apibase.Result;
import org.jretty.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


/**
 * 角色管理
 */
@RestController
@RequestMapping("/sys/role")
public class RoleController extends AbstractController {
	/**
	 * 角色列表
	 */
	@RequestMapping("/list")
	public Result<?> list(@RequestParam(required=false) String roleName, 
            @RequestParam(required=false) String sidx, 
            @RequestParam(required=false) String order, 
            @RequestParam("page") int pageNum,
            @RequestParam("limit") int pageSize){
	    
	    Map<String, Object> params = new HashMap<String, Object>();
	    if (UT.Str.isNotBlank(roleName)) {
            params.put("roleName", roleName);
        }
        if (UT.Str.isNotBlank(sidx)) {
            params.put("sidx", sidx);
        }
        if (StringUtils.isNotBlank(order)) {
            params.put("order", order);
        }
        
        // 查询列表数据
        // PagerData<RoleEntity> list = roleService.selectByPage(pageNum, pageSize, params);
		
        return Result.success("list");
	}

}
